Installing OPA-JAVA on WINDOWS



Hardware, Operating System and Networking Requirements
	
* Windows-capable server or high-end PC
* 2G RAM, or higher
* 10 GB free hard disk space
* Windows 2003 Server or higher Operating System
* Access to Internet, with broadband connection

Software Prerequisites

Software Components
 
1. Java (tm) 2 SDK, Standard Edition - version 1.4.2 or higher.
Download it at:      http://java.sun.com/j2se/1.4.2/download.html   
Download and follow the installation instructions

2. TOMCAT 5 or higher
Download the Windows Installer from: http://tomcat.apache.org/ ; and run it. It will set up Tomcat as a Windows service

3.MySQL Version 5.x (or higher) Database Server
Download it at:http://www.mysql.com
Download and/or follow the installation instructions.

Also download the JDBC driver(s) for MySQL - mysql-connector-java-3.0.x-stable-bin.jar -
where 'x' is 8,9,10,11, etc. You may have to try one or more of them to find the one that
works for your installation. Download all and delete those not needed later.

4. Web Browser
Internet Explorer Version 6.0 or higher;
or Netscape 7.0 or higher; or FireFox 1.0 or higher

5. OPA-JAVA Application
There are usually two zip files: the main application file and the help file. 
Download both.

Important: Install required software in the order shown above, except for Web Browser 
which probably was installed with the Operating System. 


=======================================================================================
OPA-JAVA Installation 
=======================================================================================

1. Unzip the zip file to some temporary folder. 

2.Copy the MySQL driver ("mysql-connector-java-3.0.x-stable-bin.jar") downloaded above
to     <TOMCAT_HOME>\common\lib\
      
* <TOMCAT_HOME> is the Tomcat installation home folder 
             
If there is difficulty connecting to the OPA database, it may be related to the
version of the driver. Download and try versions until you get the one that works 
for your installation.


3. Copy the archive contents as follows:

=======================================================================================
database\     Folder
=======================================================================================

This folder contains the SQL scripts for creating tables and populating those 
needed for initial startup. To run these scripts

1. Create the OPA-JAVA database

      Start DOS Command Prompt 
      Change directory to the directory <MYSQL HOME>\bin
      Enter the command "mysql -u root -p"  and hit Enter. 
      Hit Enter again without entering a password.
      Type "create database opa;"  and hit Enter
      Type "use opa;" and hit Enter
 
a. Run the create_db.sql script 
Type "source /folder/create_db.sql;"     where /folder/ is the path to 
the location of the SQL scripts.  
Hit Enter.  
The database tables are created.

NOTE: If your database is not named 'opa', edit the script and substitute the proper name.

b.   In similar fashion run all the scripts in \database\data_inserts folder. 
These scripts insert initial data in the database like languages, phrases, and default values.
      
=============================================================================================
opa\     Folder
==============================================================================================

This folder contains the OPA application files.

Copy "opa" subdirectory and paste as a subdirectory of <JWSDP HOME>\webapps\

The OPA directory now looks like
  \opa\
  \opa\admin\
   \opa\archive\
and so on.


=============================================================================================
Help Files     
==============================================================================================

Unzip the help zip file to some temporary folder.

Copy its content to
  \opa\help\html\ 
where \opa\ is your application folder. 


=============================================================================================
context.xml  file. 
=============================================================================================
This is the context file for OPA Application. It is located in 
<TOMCAT_HOME>\webapps\opa\META-INF folder.Edit  the file using a text editor.

Make changes, as appropriate, to the specifications beween <Context> and </Context>; 
especially your database user name and password, and the database name.
==============================================================================
<Context path="/opa" docBase="opa"
            debug="5" reloadable="true" crossContext="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_opa_log." suffix=".txt"
             timestamp="true"/>
	    
	    
    <Resource name="jdbc/opa" auth="Container" type="javax.sql.DataSource"
					   maxActive="100" maxIdle="30" maxWait="10000"
					   username="username" password="password" driverClassName="com.mysql.jdbc.Driver"
					   factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
					   url="jdbc:mysql://localhost:3306/opa?autoReconnect=true"/> 

					   

     <ResourceLink name="jdbc/opa" global="jdbc/opa" type="javax.sql.DataSource"/>	

</Context>

Save context.xml.


=============================================================================================
web.xml  file. 
=============================================================================================
This is the configuration file for OPA Application. It is located in 

Copy this file to <TOMCAT_HOME>\webapps\opa\WEB-INF  folder.
Edit  the file using a text editor.

Make changes, as appropriate, to the specifications beween <web-app> and </web-app>; 
especially your database resource reference name and context parameter.
name and password, and the database name. The database context parameter and resource reference name ("jdbc/opa") must 
match the resource name in the context.xml file (as defined above)

===================================================================================
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<!-- <!DOCTYPE web-app
          PUBLIC
          "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
          "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
	  

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4"> 

 
    <context-param>
        <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name>
        <param-value>jdbc/opa</param-value>
    </context-param>

    <resource-ref>
        <description>mysql database connection</description>
        <res-ref-name>jdbc/opa</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

<jsp-config>
	
<taglib>
	<taglib-uri>http://archer-soft.com/taglibs/cf
	</taglib-uri>

	<taglib-location>/WEB-INF/cf.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://jakarta.apache.org/taglibs/mailer-1.1
	</taglib-uri>

	<taglib-location>/WEB-INF/taglibs-mailer.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/core
	</taglib-uri>

	<taglib-location>/WEB-INF/c.tld
	</taglib-location>
</taglib>
<taglib>
	<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
	<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
	<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>

	<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/xml
	</taglib-uri>

	<taglib-location>/WEB-INF/x.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/functions
	</taglib-uri>

	<taglib-location>/WEB-INF/fn.tld
	</taglib-location>
</taglib>

</jsp-config>

</web-app>
============================================================================================
Save web.xml.
===========================================================================================

1. Restart your computer.

2. Start Tomcat (if it the service was not automatically started)

3. Start OPA as Administrator/Reviewer

       Start your Web Browser (Internet Explorer, Netscape , ...)
           
           Enter on the address line:

                http://localhost:8080/opa/admin   (if using localhost)
		http://nnn.nnn.nnn.nnn:8080/opa/admin   (if using IP Address   nnn.nnn.nnn.nnn)
		http://abc.com:8080/opa/admin   (if using Web Address abc.com)

       Start OPA as Public User

          Start your Web Browser (Internet Exploree, Netscape , ...)
           
           Enter on the address line:

             http://localhost:8080/opa/(if using localhost)
	     http://nnn.nnn.nnn.nnn:8080/opa/(if using IP Address nnn.nnn.nnn.nnn)
	     http://abc.com:8080/opa/(if using Web Address abc.com)
  
          
